
import java.io.File;

import sk.upjs.gursky.bplustree.BPTree;
import sk.upjs.gursky.bplustree.entries.BPKeyInt;
import sk.upjs.gursky.bplustree.entries.BPObjectIntDouble;

public class TestBPTree {
	
	public static void main(String[] args) throws Exception {
	
		BPTree<BPKeyInt, BPObjectIntDouble> tree =  new BPTree<BPKeyInt, BPObjectIntDouble>(BPObjectIntDouble.class,new File("indexBP.idx"));
//        tree.setNodeSize(8192);         //default is 4096
//        tree.setCacheCapacity(100);     //default is 10
        tree.openNewFile();
        for (int i = 0; i < 100; i++) {
        	tree.add(new BPObjectIntDouble((int)(Math.random()*1000000000),Math.random()));
        }
        
        
        
        for (BPObjectIntDouble entry : tree) {
        	System.out.println(entry);
        }
        tree.close();
	}
}